package ioexercise;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

public class OSWDemo {
    public static void main(String[] args) throws IOException {
        //转换流
        FileOutputStream fos=new FileOutputStream("osw.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        String line="离离原上草，一岁一枯荣";
        String line1="野火烧不尽，春风吹又生";
        osw.write(line);
        osw.write(line1);
        osw.close();
        System.out.println("写出完毕");
    }
}
